﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PloobsEngine.Modelo;
using Microsoft.Xna.Framework;
using BezierApp;
using Microsoft.Xna.Framework.Graphics;

namespace Etapa1.BezierExperiments
{
    public class VertexBufferModel : IModelo
    {
        BatchInformation[] bi = new BatchInformation[1];
        VertexBuffer vb;
        public VertexBufferModel(VertexBuffer vb, int primitiveCount , VertexDeclaration vd,int stride)
        {
            this.vb = vb;
            bi[0] = new BatchInformation(0, -1 , primitiveCount, 0, 0, vd, stride);
        }

        public void ResetModel(VertexBuffer vb, int primitiveCount, VertexDeclaration vd, int stride)
        {
            this.vb = vb;
            bi[0] = new BatchInformation(0, -1, primitiveCount, 0, 0, vd, stride);
        }

        #region IModelo Members

        public void LoadModelo()
        {
            
        }

        public void Serialize(System.Xml.XmlTextWriter textWriter)
        {
            
        }

        public void DeSerialize(System.Xml.XmlNode node, PloobsEngine.EngineStuff engine)
        {
            
        }

        public object getModelTag()
        {
            return null;
        }

        public Microsoft.Xna.Framework.Graphics.ModelMesh[] getModelMeshes()
        {
            return null;
        }
        Matrix[] bonesTrans = new Matrix[] { Matrix.Identity };

        public Microsoft.Xna.Framework.Matrix[] getBonesTransformation()
        {
            return bonesTrans;
        }

        public Microsoft.Xna.Framework.Graphics.Texture2D getTexture(TextureType textureType)
        {
            return null;
        }

        public Microsoft.Xna.Framework.BoundingSphere GetBoudingSphere()
        {
            return new BoundingSphere();
        }

        public int GetParentBoneIndex(int meshNumber)
        {
            return -1;
        }

        public int MeshNumber
        {
            get { return 1; }
        }

        public Microsoft.Xna.Framework.Graphics.VertexBuffer GetVertexBuffer(int meshNumber)
        {
            return vb;
        }

        public Microsoft.Xna.Framework.Graphics.IndexBuffer GetIndexBuffer(int meshNumber)
        {
            return null;
        }


        public BatchInformation[] GetBatchInformation(int meshNumber)
        {
            return bi;
        }

        public string Name
        {
            get;
            set;
        }

        #endregion
    }
}
